package exteditapp.state;

import java.io.File;

import exteditapp.AppletIterator;
import exteditapp.FileDefault;
import exteditapp.action.ActionUploading;
import exteditapp.command.CommandUpload;

/**
 * State - upload process (shows percentage progress)
 * @author Arturas Smorgun, arturas@smorgun.lt
 */
public class StateUploading extends IState {

	protected File tmpUpload;
	
	/**
	 * Default constructor
	 * @param iterator is system iterator, which performs all actions
	 * @param file this is file, which state we will hold
	 */
	public StateUploading(AppletIterator iterator, FileDefault file) {
		super(iterator, file);
//		this.main.getWorkingFile().setCurrentState(new StateEditingDone(this.main.getWorkingFile().getCurrentState().getIterator(), this.main.getWorkingFile()));

		start();
	}
	public StateUploading(AppletIterator iterator, FileDefault file, boolean doRegister){
		super(iterator, file, doRegister);
		start();
	}
	
	protected void start() {
		this.setAction(new ActionUploading());
		this.file.getModule().getInvoker().execute(new CommandUpload(this.file));
	}
	
	/**
	 * Handlink of new state
	 */
	public boolean handle() {
		//TODO implement upload state handling
		return false;
	}

}
